/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package presentation.view;

import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableColumn;
import presentation.controller.ControlPanelAñadirMateria;
import vo.*;

/**
 *
 * @author Joanna 8a
 */
public class PanelAñadirMateria extends javax.swing.JPanel {

    /**
     * Creates new form PanelAñadirMateria
     */
    public PanelAñadirMateria(FramePrincipal parent) {
        initComponents();
        this.parent = parent;
        jSpinner_Creditos.setModel(new javax.swing.SpinnerNumberModel(1, 1, 20, 1));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButtonAmat = new javax.swing.JButton();
        jTextField_CodigoMat = new javax.swing.JTextField();
        jLabelCodMatAdMat = new javax.swing.JLabel();
        jTextField_NombreMat = new javax.swing.JTextField();
        jLabelNombreAmat = new javax.swing.JLabel();
        jPanelGruposAdMat = new javax.swing.JPanel();
        jButton_GuardarDatos = new javax.swing.JButton();
        jButton_AñadirGrupo = new javax.swing.JButton();
        jButton_QuitarGrupo = new javax.swing.JButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTableGrNumSal = new javax.swing.JTable();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableGrsAdMat = new javax.swing.JTable();
        jButton_AñadirProfesor = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jSpinner_Creditos = new javax.swing.JSpinner();
        jButton1 = new javax.swing.JButton();

        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Adición de Materias", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), new java.awt.Color(204, 0, 204))); // NOI18N

        jButtonAmat.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButtonAmat.setText("Añadir Materia");
        jButtonAmat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAmatActionPerformed(evt);
            }
        });

        jTextField_CodigoMat.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N

        jLabelCodMatAdMat.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jLabelCodMatAdMat.setText("Código De La Materia");

        jTextField_NombreMat.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N

        jLabelNombreAmat.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jLabelNombreAmat.setText("Nombre de la Materia");

        jPanelGruposAdMat.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Grupos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14))); // NOI18N

        jButton_GuardarDatos.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButton_GuardarDatos.setText("Guardar Datos del Grupo");
        jButton_GuardarDatos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_GuardarDatosActionPerformed(evt);
            }
        });

        jButton_AñadirGrupo.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButton_AñadirGrupo.setText("Añadir Grupo");
        jButton_AñadirGrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_AñadirGrupoActionPerformed(evt);
            }
        });

        jButton_QuitarGrupo.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButton_QuitarGrupo.setText("Quitar Grupo");
        jButton_QuitarGrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_QuitarGrupoActionPerformed(evt);
            }
        });

        jTableGrNumSal.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jTableGrNumSal.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Grupo", "Número de Dias De Clase"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableGrNumSal.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableGrNumSalMouseClicked(evt);
            }
        });
        jScrollPane5.setViewportView(jTableGrNumSal);

        jTableGrsAdMat.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jTableGrsAdMat.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "# Grupo", "Salón", "Día", "Hora", "Duración", "Profesor"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Double.class, java.lang.Double.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTableGrsAdMat);

        jButton_AñadirProfesor.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButton_AñadirProfesor.setText("Añadir Profesor");
        jButton_AñadirProfesor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_AñadirProfesorActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelGruposAdMatLayout = new javax.swing.GroupLayout(jPanelGruposAdMat);
        jPanelGruposAdMat.setLayout(jPanelGruposAdMatLayout);
        jPanelGruposAdMatLayout.setHorizontalGroup(
            jPanelGruposAdMatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 513, Short.MAX_VALUE)
            .addComponent(jScrollPane1)
            .addGroup(jPanelGruposAdMatLayout.createSequentialGroup()
                .addGap(59, 59, 59)
                .addComponent(jButton_AñadirGrupo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton_QuitarGrupo)
                .addGap(110, 110, 110))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelGruposAdMatLayout.createSequentialGroup()
                .addGap(63, 63, 63)
                .addComponent(jButton_AñadirProfesor)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton_GuardarDatos)
                .addGap(67, 67, 67))
        );
        jPanelGruposAdMatLayout.setVerticalGroup(
            jPanelGruposAdMatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelGruposAdMatLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelGruposAdMatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_AñadirGrupo)
                    .addComponent(jButton_QuitarGrupo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanelGruposAdMatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_AñadirProfesor)
                    .addComponent(jButton_GuardarDatos))
                .addGap(217, 217, 217))
        );

        jLabel1.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jLabel1.setText("Número de Créditos");

        jButton1.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButton1.setText("Cancelar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jPanelGruposAdMat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabelNombreAmat)
                                    .addComponent(jTextField_NombreMat, javax.swing.GroupLayout.PREFERRED_SIZE, 476, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabelCodMatAdMat)
                                    .addComponent(jTextField_CodigoMat, javax.swing.GroupLayout.PREFERRED_SIZE, 476, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jSpinner_Creditos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(50, 50, 50)
                                .addComponent(jButtonAmat, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(68, 68, 68)
                                .addComponent(jButton1)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabelNombreAmat)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_NombreMat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelCodMatAdMat)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_CodigoMat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jSpinner_Creditos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelGruposAdMat, javax.swing.GroupLayout.PREFERRED_SIZE, 479, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonAmat)
                    .addComponent(jButton1)))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_AñadirProfesorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_AñadirProfesorActionPerformed
        // TODO add your handling code here:
        FrameAñadirProfesor frAñPr = new FrameAñadirProfesor();
        frAñPr.setLocationRelativeTo(this);
        frAñPr.setVisible(true);
    }//GEN-LAST:event_jButton_AñadirProfesorActionPerformed

    private void jButton_AñadirGrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_AñadirGrupoActionPerformed
        DefaultTableModel mod = (DefaultTableModel) jTableGrNumSal.getModel();

        GrupoVO vo = new GrupoVO();
        if (mod.getRowCount() > 0) {
            vo.setNumeroGrupo((int) mod.getValueAt(mod.getRowCount() - 1, 0) + 1);
        } else {
            vo.setNumeroGrupo(1);
        }
        grupos.add(vo);

        TableColumn col1 = jTableGrNumSal.getColumnModel().getColumn(1);
        SpinnerEditor spinner = new SpinnerEditor();
        col1.setCellEditor(spinner);
        spinner.stopCellEditing();

        Object[] row = new Object[6];
        row[0] = vo.getNumeroGrupo();
        row[1] = 1;
        mod.addRow(row);
    }//GEN-LAST:event_jButton_AñadirGrupoActionPerformed

    private void jButton_QuitarGrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_QuitarGrupoActionPerformed
        DefaultTableModel mod = (DefaultTableModel) jTableGrNumSal.getModel();
        if (mod.getRowCount() > 0) {
            mod.removeRow(filaGrupo);
            grupos.remove(filaGrupo);
        }
        filaGrupo = 0;
    }//GEN-LAST:event_jButton_QuitarGrupoActionPerformed

    private void jTableGrNumSalMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableGrNumSalMouseClicked
        filaGrupo = jTableGrNumSal.rowAtPoint(evt.getPoint());
        DefaultTableModel mod = (DefaultTableModel) jTableGrNumSal.getModel();
        añadirFilasTabla2((int) mod.getValueAt(filaGrupo, 1));
    }//GEN-LAST:event_jTableGrNumSalMouseClicked

    private void jButton_GuardarDatosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_GuardarDatosActionPerformed
        guardarDatosGrupo();
    }//GEN-LAST:event_jButton_GuardarDatosActionPerformed

    private void jButtonAmatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAmatActionPerformed
        MateriaVO vo = new MateriaVO();
        vo.setNombre(jTextField_NombreMat.getText());
        vo.setCodigo(Integer.parseInt(jTextField_CodigoMat.getText()));
        vo.setCreditos((int)jSpinner_Creditos.getValue());
        vo.setGrupos(grupos);
        new ControlPanelAñadirMateria().crearMateria(vo);
        JOptionPane.showMessageDialog(this, "Materia agragada correctamente!", "Aviso", JOptionPane.INFORMATION_MESSAGE);
        parent.cambiarPanel(new PanelPrincipal(parent));
    }//GEN-LAST:event_jButtonAmatActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        parent.cambiarPanel(new PanelPrincipal(parent));
    }//GEN-LAST:event_jButton1ActionPerformed

    private void añadirFilasTabla2(int numFilas) {

        TableColumn col = jTableGrsAdMat.getColumnModel().getColumn(5);
        JComboBox combo = new JComboBox();
        List<IValueObject> profesores = new ControlPanelAñadirMateria().obtenerProfesores();
        for (IValueObject prof : profesores) {
            combo.addItem(((ProfesorVO) prof).getNombre() + " " + ((ProfesorVO) prof).getApellido());
        }

        col.setCellEditor(new DefaultCellEditor(combo));

        DefaultTableModel mod = (DefaultTableModel) jTableGrsAdMat.getModel();

        if (mod.getRowCount() > 0) {
            if (grupos.get(filaGrupo).getNumeroGrupo() == mod.getValueAt(0, 0)) {
                int filas = mod.getRowCount();
                int dif = numFilas - filas;
                if (dif > 0) {
                    Object[] fila = new Object[6];
                    for (int i = filas; i < numFilas; i++) {
                        llenarFila(fila, i);
                    }
                } else {
                    for (int i = 0; i > dif; i--) {
                        mod.removeRow(mod.getRowCount() - 1);
                        grupos.get(filaGrupo).getDiasDeClase().remove(mod.getRowCount() - 1);
                    }
                }
            } else {
                guardarDatosGrupo();
                int a = mod.getRowCount() - 1;
                for (int i = 0; i <= a; i++) {
                    mod.removeRow(0);
                }
                Object[] fila = new Object[6];
                for (int i = 0; i < numFilas; i++) {
                    llenarFila(fila, i);
                }
            }
        } else {
            Object[] fila = new Object[6];
            for (int i = 0; i < numFilas; i++) {
                llenarFila(fila, i);
            }
        }
    }

    private void llenarFila(Object[] fila, int i) {
        DefaultTableModel mod = (DefaultTableModel) jTableGrsAdMat.getModel();
        fila[0] = grupos.get(filaGrupo).getNumeroGrupo();
        List<DiaDeClaseVO> dias = grupos.get(filaGrupo).getDiasDeClase();
        if (dias.size() == i) {
            dias.add(new DiaDeClaseVO());
        } else {
            fila[1] = dias.get(i).getSalon();
            fila[2] = dias.get(i).getDia();
            fila[3] = dias.get(i).getHora();
            fila[4] = dias.get(i).getDuracion();
            ProfesorVO profVo = new ControlPanelAñadirMateria().buscarProfesor(dias.get(i).getProfesorId());
            if (profVo != null) {                
                fila[5] = profVo.getNombre() + " " + profVo.getApellido();
            }
        }
        mod.addRow(fila);
    }

    private void guardarDatosGrupo() {
        DefaultTableModel mod = (DefaultTableModel) jTableGrsAdMat.getModel();
        int a = mod.getRowCount() - 1;
        for (int i = 0; i <= a; i++) {
            DiaDeClaseVO vo = grupos.get((int) mod.getValueAt(0, 0) - 1).getDiasDeClase().get(i);
            if (mod.getValueAt(i, 1) != null) {
                vo.setSalon((String) mod.getValueAt(i, 1));
            }
            if (mod.getValueAt(i, 2) != null) {
                vo.setDia((String) mod.getValueAt(i, 2));
            }
            if (mod.getValueAt(i, 3) != null) {
                vo.setHora((double) mod.getValueAt(i, 3));
            }
            if (mod.getValueAt(i, 4) != null) {
                vo.setDuracion((double) mod.getValueAt(i, 4));
            }
            if (mod.getValueAt(i, 5) != null) {
                String[] profe = ((String) mod.getValueAt(i, 5)).split(" ");
                String nombre = profe[0];
                String apellido = profe[1];
                System.out.println(nombre+" "+apellido);
                ProfesorVO profeVO = new ControlPanelAñadirMateria().buscarProfesorPorNombre(nombre, apellido);
                vo.setProfesorId(profeVO.getId());
            }
        }
    }

    class SpinnerEditor extends AbstractCellEditor implements TableCellEditor {

        private javax.swing.JSpinner spinner;

        public SpinnerEditor() {
            spinner = new JSpinner();
            SpinnerNumberModel spinnerModel = new javax.swing.SpinnerNumberModel(1, 1, 7, 1);
            spinner.setModel(spinnerModel);
            spinner.addChangeListener(new javax.swing.event.ChangeListener() {

                @Override
                public void stateChanged(ChangeEvent e) {
                    filaGrupo = jTableGrNumSal.rowAtPoint(spinner.getLocation());
                    añadirFilasTabla2((int) spinner.getValue());

                }
            });
        }

        @Override
        public Object getCellEditorValue() {
            return spinner.getValue();
        }

        @Override
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            return spinner;
        }
    }
    private ArrayList<GrupoVO> grupos = new ArrayList<>();
    private int filaGrupo;
    private FramePrincipal parent;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButtonAmat;
    private javax.swing.JButton jButton_AñadirGrupo;
    private javax.swing.JButton jButton_AñadirProfesor;
    private javax.swing.JButton jButton_GuardarDatos;
    private javax.swing.JButton jButton_QuitarGrupo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabelCodMatAdMat;
    private javax.swing.JLabel jLabelNombreAmat;
    private javax.swing.JPanel jPanelGruposAdMat;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JSpinner jSpinner_Creditos;
    private javax.swing.JTable jTableGrNumSal;
    private javax.swing.JTable jTableGrsAdMat;
    private javax.swing.JTextField jTextField_CodigoMat;
    private javax.swing.JTextField jTextField_NombreMat;
    // End of variables declaration//GEN-END:variables
}
